import '../public/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'


import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import ECharts from 'vue-echarts';
import * as echarts from 'echarts';

import App from './App.vue'
import router from './router'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})

// 全局注册 vue-echarts 组件
app.component('v-chart', ECharts);

// 全局挂载 echarts
app.config.globalProperties.$echarts = echarts;

app.use(createPinia())
app.use(router)
app.use(ElementPlus)

// window.addEventListener('beforeunload', function() {
//   localStorage.clear(); // 清空所有 localStorage 数据
// });

app.mount('#app')
